<?php

declare (strict_types=1);

namespace app\api\controller;

use app\common\library\wechat\WxPay;
use app\common\exception\BaseException;
use think\facade\Log;

/**
 * 支付成功异步通知接口
 * Class Notify
 * @package app\api\controller
 */
class Notify
{
    /**
     * 支付成功异步通知(微信小程序-微信支付)
     * @throws \think\db\exception\DataNotFoundException
     * @throws \think\db\exception\DbException
     * @throws \think\db\exception\ModelNotFoundException
     */
    public function wxpay()
    {
        // 微信支付组件：验证异步通知
        $WxPay = new WxPay();
        $WxPay->notify();
    }

    public function wxpayByH5()
    {
        Log::channel('wxpay')->info('H5开始回调……');
        // 微信支付组件：验证异步通知
        $WxPay = new WxPay();
        $WxPay->notifyByH5();
    }
}
